package com.tony.mindhr.mapper;

import com.tony.mindhr.model.Department;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Title: DepartmentMapper
 * @Auther: 皮蛋布丁
 * @Date: 2021/04/19/14:01
 * @Description:
 */
public interface DepartmentMapper {

    /**
    * @Description: deleteByPrimaryKey 根据id删除部门
    * @Param: [id]
    * @return: int
    * @Author: 皮蛋布丁
    */
    int deleteByPrimaryKey(Integer id);

    /**
    * @Description: insert 新增部门信息
    * @Param: [record]
    * @return: int
    * @Author: 皮蛋布丁
    */
    int insert(Department record);

    /**
    * @Description: insertSelective 有选择性的新增部门信息
    * @Param: [record]
    * @return: int
    * @Author: 皮蛋布丁
    */
    int insertSelective(Department record);

    /**
    * @Description: selectByPrimaryKey 根绝id获取部门信息
    * @Param: [id]
    * @return: com.tony.mindhr.model.Department
    * @Author: 皮蛋布丁
    */
    Department selectByPrimaryKey(Integer id);

    /**
    * @Description: updateByPrimaryKeySelective 根绝id有选择性的更新部门信息
    * @Param: [record]
    * @return: int
    * @Author: 皮蛋布丁
    */
    int updateByPrimaryKeySelective(Department record);

    /**
    * @Description: updateByPrimaryKey 根绝id更新部门信息
    * @Param: [record]
    * @return: int
    * @Author: 皮蛋布丁
    */
    int updateByPrimaryKey(Department record);

    /**
    * @Description: getAllDepartmentsByParentId 获取所有部门
    * @Param: []
    * @return: java.util.List<com.tony.mindhr.model.Department>
    * @Author: 皮蛋布丁
    * @Date: 2021/6/5 16:29
    */
    List<Department> getAllDepartmentsByParentId(Integer pid);

    /**
    * @Description: addDep 添加部门
    * @Param: [dep]
    * @return: void
    * @Author: 皮蛋布丁
    * @Date: 2021/6/6 16:43
    */
    void addDep(Department dep);

    /**
    * @Description: deleteDepById 根据id删除部门
    * @Param: [dep]
    * @return: void
    * @Author: 皮蛋布丁
    * @Date: 2021/6/6 21:22
    */
    void deleteDepById(Department dep);

    List<Department> getAllDepartmentsWithOutChildren();
}
